<?php
session_start(); 
if(!isset($_SESSION['userName'])){
header( 'location:../../index.php' ); 
} 
	include("../../conf/connect.php");
	$user_id = $_SESSION['user_id'];
	$hhid= $_SESSION['usrHHid'];
	$resp_id = $_GET['resp_id'];
	$search_id=$_GET['search_id'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="../../style.css" media="screen" />
	<link rel="shortcut icon" href="images/favicon.ico" />
</head>
<body class="iub_back">
		<table align="center" class="table_border">
			<tr>
					<td class="header"><b class="htext">IUB Survey :: </b><br /><hr /> </td>
			</tr>
			<tr>
					<td> Field : </td>
			</tr>
			<form action="update_operation.php?qus=upd1" method="post">
			<input type="hidden" name="resp_id" value="<?php echo $resp_id;?>" />
			<tr>
					<td>
						<select name="qusNo">						
								<option value="emp01">EMP01</option>
								<option value="emp02">EMP02</option>
								<option value="emp03">EMP03</option>
								<option value="emp04_a">EMP04a</option>
								<option value="emp04_b">EMP04b</option>
								<option value="emp05">EMP05</option>
								<option value="emp06">EMP06</option>
								<option value="emp07">EMP07</option>									
						</select>
					</td>
			</tr>
			<tr>
					<td align="right" valign="bottom"><input type="submit" value="Update" class="input-box" /> &nbsp;&nbsp;<a href="../index2.php" class="input-box"> Home &nbsp;&nbsp; </a></td>
			</tr>
			</form>
			<tr>
					<td> Answer(s) :</td>
			</tr>
			<?php
				$sql ="SELECT * FROM adult_question where hid='$hhid' and resp_id=$resp_id";
				$result=mysql_query( $sql);
				while($row = mysql_fetch_array($result)){
				
			?>
			<tr>
				<td>
					EMP01&nbsp;:&nbsp;&nbsp;
					<?php 
						$data=$row['emp01'];
						
						$hello="SELECT * FROM retreive_data where qus='emp01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						} 
					?> 
				</td>
			</tr>
			<tr>
				<td>
					EMP02&nbsp;:&nbsp;&nbsp;
					<?php 
						echo $data=$row['emp02'];
						
						$hello="SELECT * FROM retreive_data where qus='emp01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						} 
					?> 
				</td>
			</tr>
			<tr>
				<td>
					EMP03&nbsp;:&nbsp;&nbsp;
					<?php 
						$data=$row['emp03'];
						
						$hello="SELECT * FROM retreive_data where qus='q7' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						} 
					?> 
				</td>
			</tr>
			<tr>
				<td>
					EMP04a&nbsp;:&nbsp;&nbsp;
					<?php 
						$data=$row['emp04_a'];
						
						$hello="SELECT * FROM retreive_data where qus='q7' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						} 
					?> 
				</td>
			</tr>
			<tr>
				<td>
					EMP04b&nbsp;:&nbsp;&nbsp;
					<?php 
						$data=$row['emp04_b'];
						
						$hello="SELECT * FROM retreive_data where qus='q7' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						} 
					?> 
				</td>
			</tr>
			<tr>
				<td>
					EMP05&nbsp;:&nbsp;&nbsp;
					<?php 
						$data=$row['emp05'];
						
						$hello="SELECT * FROM retreive_data where qus='q7' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						} 
					?> 
				</td>
			</tr>
			<tr>
				<td>
					EMP06&nbsp;:&nbsp;&nbsp;
					<?php 
						$data=$row['emp06'];
						
						$hello="SELECT * FROM retreive_data where qus='q7' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						} 
					?> 
				</td>
			</tr>
			<tr>
				<td>
					EMP07&nbsp;:&nbsp;&nbsp;
					<?php 
						echo $data=$row['emp07'];
						
					?>  TK.
				</td>
			</tr>
			<?php } ?>
		</table>
		